﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="List.ascx.vb" Inherits="Control_VBPQOffice_List" %>
<script type="text/javascript">

    function setKeyWordParentValues() {
        var text = '';
        var sid = '';
        $("select#<%=lbxOffice.ClientID()%>").find("option:selected").each(function () {
            t = $(this).text();
            text += t + ';';
            sid += $(this).val() + ';';
        });
        window.parent.setKeyWordValue(text, sid);
        window.parent.tb_remove();
        return false; //prevent Submit
    }

    $(function () {
        var sListId = window.parent.getKeywordValue();
        $("#<%=txtListIdOffice.ClientID()%>").val(sListId);
        var arrSlistId = sListId.split(';');

        for (i = 0; i < arrSlistId.length - 1; i++) {
            $("#<%=lbxOffice.ClientId %> option[value=" + arrSlistId[i] + "]").attr("selected", "selected");
        }
        return false;
    });
</script>
<asp:UpdatePanel ID="upnlOfficeList" runat="server">
<ContentTemplate>
<div class="BoxField" style="background-color:#ffffff; padding-top: 8px;">
    <div class="DivRow">
        <div class="DivLabel">
            <asp:Label ID="lblGroupname" CssClass="TextLabel" runat="server" Text="Nhập chức danh: " /><span
                class="fieldRequired"></span>
        </div>
        <div class="DivTextBox">
            <asp:TextBox ID="txtOffice" CssClass="TextBox" runat="server" Text="" Width="208px" />
            &nbsp;<asp:Button ID="btnSave" runat="server" Text=" Lọc " CssClass="btn" />
        </div>
    </div>    
    <div class="DivRow" style="padding-top: 10px">
        <div class="DivTextBox" style="float: left">
            <asp:ListBox ID="lbxOffice" runat="server" Height="234px" Width="208px"></asp:ListBox>
        </div>
        <div class="DivLabel" style="float: left">           
            &nbsp;&nbsp;<asp:Button ID="btnEdit" CssClass="btn" runat="server" Text="Sửa" CausesValidation="False" /><br /><br />
            &nbsp;&nbsp;<asp:Button ID="btnDelete" CssClass="btn" runat="server" Text="Xóa" CausesValidation="False" />
        </div>
    </div>  
</div>
<div style="display: none">
    <asp:HiddenField ID="hidID" Value="0" runat="server" />   
    <asp:TextBox ID = "txtListIdOffice" runat="server" Text = ""></asp:TextBox> 
</div>

</ContentTemplate>
</asp:UpdatePanel>